package com.vcredit.creditcat.manager;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.vcredit.creditcat.api.ICreditDiagnoseManager;
import com.vcredit.creditcat.dto.creditdiagnose.ProducItemDiagnoseDto;
import com.vcredit.creditcat.model.Cust;
import com.vcredit.creditcat.service.CreditDiagnoseService;
import com.vcredit.creditcat.util.Utility;

/**
 * 信用诊断
 * 
 * @author zhaoqi01
 *
 */
@Service(protocol = { "protocol1" }, version = "1.0")
public class CreditDiagnoseManager implements ICreditDiagnoseManager {

	private static final Logger LOG = LoggerFactory.getLogger(CreditDiagnoseManager.class);

	@Autowired
	private CreditDiagnoseService creditDiagnoseService;

	@Override
	public List<ProducItemDiagnoseDto> list(Cust cust, Long[] productIdArr) {
		List<ProducItemDiagnoseDto> resultDto = new ArrayList<ProducItemDiagnoseDto>();
		try {
			resultDto = creditDiagnoseService.list(cust, productIdArr);
		} catch (Exception e) {
			LOG.error("----------------信用诊断失败 " + "params{custId=" + cust.getCustId() + ",productIdArr="
					+ Utility.arrToStr(productIdArr) + "}", e);
		}
		return resultDto;
	}

}
